package com.jeesite.modules.dp.entity.usercart;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 购物车Entity
 * @author hancing
 * @version 2024-12-20
 */
@Table(name="dp_usercart", alias="a", label="购物车信息", columns={
		@Column(name="id", attrName="id", label="id", isPK=true),
		@Column(name="userno", attrName="userno", label="用户账号"),
		@Column(name="kcid", attrName="kcid", label="课程ID"),
		@Column(name="kctitle", attrName="kctitle", label="课程标题"),
		@Column(name="kcimg", attrName="kcimg", label="课程图片"),
		@Column(name="cartnum", attrName="cartnum", label="数量", isUpdateForce=true),
		@Column(name="cartprice", attrName="cartprice", label="单价", isUpdateForce=true),
		@Column(includeEntity=DataEntity.class),
	}, orderBy="a.update_date DESC"
)
public class DpUsercart extends DataEntity<DpUsercart> {
	
	private static final long serialVersionUID = 1L;
	private String userno;		// 用户账号
	private String kcid;		// 课程ID
	private String kctitle;		// 课程标题
	private String kcimg;		// 课程图片
	private Long cartnum;		// 数量
	private Double cartprice;		// 单价

	public DpUsercart() {
		this(null);
	}
	
	public DpUsercart(String id){
		super(id);
	}
	
	@NotBlank(message="用户账号不能为空")
	@Size(min=0, max=36, message="用户账号长度不能超过 36 个字符")
	public String getUserno() {
		return userno;
	}

	public void setUserno(String userno) {
		this.userno = userno;
	}
	
	@NotBlank(message="课程ID不能为空")
	@Size(min=0, max=36, message="课程ID长度不能超过 36 个字符")
	public String getKcid() {
		return kcid;
	}

	public void setKcid(String kcid) {
		this.kcid = kcid;
	}
	
	@Size(min=0, max=255, message="课程标题长度不能超过 255 个字符")
	public String getKctitle() {
		return kctitle;
	}

	public void setKctitle(String kctitle) {
		this.kctitle = kctitle;
	}
	
	@Size(min=0, max=255, message="课程图片长度不能超过 255 个字符")
	public String getKcimg() {
		return kcimg;
	}

	public void setKcimg(String kcimg) {
		this.kcimg = kcimg;
	}
	
	public Long getCartnum() {
		return cartnum;
	}

	public void setCartnum(Long cartnum) {
		this.cartnum = cartnum;
	}
	
	public Double getCartprice() {
		return cartprice;
	}

	public void setCartprice(Double cartprice) {
		this.cartprice = cartprice;
	}
	
}